/*
 * @Author: xiehangyun 
 * @Date: 2025-07-25 21:23:37 
 * @Last Modified by:   xiehangyun 
 * @Last Modified time: 2025-07-25 21:23:37 
 */

import { makeAutoObservable } from "mobx";

class Store {
    constructor() {
        makeAutoObservable(this, {}, { deep: false });
    }

    page: number = 1;//当前页面
    pageSize: number = 10;//分页数
    total: number = 0;//总数
    list: Array<any> = [];//数据列表
    hasMore: boolean = true;//是否有更多数据

    //获取数据
    getList(page: number = this.page, pageSize: number = this.pageSize) {
        this.page = page;
        this.pageSize = pageSize;
        this.list = [];// 请求数据
        this.total = 0;// 请求总数
        this.hasMore = true;// 请求是否有更多数据
    }

    //新增数据
    add(data: any) {

        this.getList();
    }

    //删除数据
    delete(id: string) {
        this.getList();
    }

    //更新数据
    updata(data: any) {
        this.getList();
    }

}

const store = new Store();

export default store;